// pages/personal/team/join.js

const postData = {
    name: "",
    phone: ""
}
const app = getApp()
Page({
    data: {

    },
    onLoad: function (options) {
        this.setData(options)
    },
    onInput(evt) {
        const key = evt.currentTarget.dataset.key
        postData[key] = evt.detail.value
    },
    submit() {
        if (!postData.name.trim()) {
            app.wxToast.warn("请填写姓名")
            return
        }
        if (!postData.phone.trim()) {
            app.wxToast.warn("请填写手机号")
            return
        }
        wx.showLoading({
            title: '加载中...',
        })
        app.http.post("shop-sale-member/apply", { data: postData }).then(res => {
            wx.hideLoading()
            wx.showModal({
                title: '提示',
                content: '申请已经提交，请耐心等待系统审核。',
                showCancel: false,
                success: res => {
                    wx.navigateBack({

                    })
                }
            })
        }).catch(err => {
            app.wxToast.error(err.message)
        })
    },

})